﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using BLL.ETL;
using BLL.Workflows;
using DO.Workflows;

namespace BLL.Workers
{
    public static class ManualWorkersRegister
    {
        private static Dictionary<string, IWorker> workers;

        static void InitWorkers()
        {
            workers = new Dictionary<string, IWorker>();
            Type type = typeof (BLL.Clustering.ClusteringWorker);
            IWorker worker = (IWorker) Activator.CreateInstance(type);
            workers.Add(worker.ComponentType.Name,worker);
            type = typeof (ManualStartWorker);
            worker = (IWorker)Activator.CreateInstance(type);
            workers.Add(worker.ComponentType.Name, worker);
            type = typeof(EmailWorker);
            worker = (IWorker)Activator.CreateInstance(type);
            workers.Add(worker.ComponentType.Name, worker);
            type = typeof (CitationParserWorker);
            worker = (IWorker) Activator.CreateInstance(type);
            workers.Add(worker.ComponentType.Name, worker);
        }

        public static Dictionary<string, IWorker> Workers
        {
            get
            {
                if (workers == null)
                    InitWorkers();
                return workers;
            }
        }
    }
}
